An arrangement like the one shown in FIG. 1 is generally used for transferring a digital video image in compressed form. The video image is formed of sequential frames. The current frame comes to the transmission system 10 as input data In(x,y). In the differential summer 11 it is transformed into a differential frame En(x,y) by subtracting from it a prediction frame Pn(x,y) formed on the basis of previous images. The differential frame is coded in block 12 in the manner described hereinafter, and the coded differential frame is directed to the multiplexer 13. For forming a new prediction frame, the coded differential frame is also directed to the decoder 14, which produces a decoded differential frame Ên(x,y) which is summed in the summer 15 with the prediction frame Pn(x,y), resulting in a decoded frame În(x,y). It is saved in the frame memory 16. For coding the next frame, the frame saved in the frame memory is read as a reference frame Rn(x,y) and in the motion compensation and prediction block 17 it is transformed into a new prediction frame according to the formulaPn(x,y)=Rn[x+Δx(x,y), y+Δy(x,y)]  (1)
The pair of numbers [Δx(x,y), Δy(x,y)] is called the motion vector of the pixel at location (x,y) and the numbers Δx(x,y) and Δy(x,y) are the horizontal and vertical shifts of the pixel. They are calculated in the motion estimation block 18 and the motion information coding block 19. The set of motion vectors [Δx(·), Δy(·)] consisting of all motion vectors related to the pixels of the frame to be compressed is also directed to the multiplexer 13, which multiplexes it into the same data stream with a coded differential frame for sending to a receiver. Some frames can be partly or entirely so difficult to predict that it is not practical to use prediction when coding them. These frames or parts of frames are coded using so-called intracoding without prediction, and motion vector information relating to them is not sent to the receiver.
In the receiver 20, the demultiplexer 21 separates the coded differential frames and the motion information transmitted by the motion vectors and directs the coded differential frames to the decoder 22, which produces a decoded differential frame Ên(x,y), which is summed in the summer 23 with the prediction frame Pn(x,y) formed on the basis of previous frames, resulting in a decoded frame În(x,y). It is directed to the output 24 of the reception decoder and at the same time saved in the frame memory 25. For decoding the next frame, the frame saved in the frame memory is read as a reference frame and transformed into a new prediction frame in the motion compensation and prediction block 26, according to the formula (1) presented above.
The coding method which is applied in block 12 to the coding of the differential frame or to the intracoding of a frame or part of it to be sent without prediction, is generally based on a transformation, the most common of which is Discrete Cosine Transformation, DCT. The frame is divided into adjacent blocks sized e.g. 8×8 pixels. In coding and decoding, the blocks are processed independent of one another. The transformation is calculated for the block to be coded, resulting in a series of terms dependent on a certain variable. The coefficients of these terms are quantized on a discrete scale in order that they can be processed digitally. Quantization causes rounding errors, which can become visible in an image reconstructed from blocks so that there is a discontinuity of pixel values at the boundary of two adjacent blocks. Because a certain decoded frame is used for calculating the prediction frame for the next frames, the errors can be repeated in sequential frames, thus causing visible edges in the image reproduced by the receiver. Image errors like this are called blocking artefacts.
Some prior art methods are known for removing the blocking artefacts. These methods are characterized by the following features:                determining which pixel requires value correction for removing the blocking artefact,        determining a suitable low-pass filtering for each pixel to be corrected, based on the values of other pixels contained by the filtering window placed around the pixel,        calculating a new value for the pixel to be corrected, and        rounding the new value to the closest digitized tonal value.        
Factors that influence the selection of a filter and a decision to introduce a filter can be, for example, the difference between the values of pixels across the block boundary, the size of the quantization step of the coefficients received as the transformation result, and the difference of the pixel values on different sides of the pixel being processed.
It has been found that the prior art methods also tend to remove lines of the image that should really be part of it. On the other hand, the prior art methods are not always capable of removing all blocking artefacts.